\hypertarget{classGraphVizExporter}{
\section{GraphVizExporter Class Reference}
\label{classGraphVizExporter}\index{GraphVizExporter@{GraphVizExporter}}
}


Interpreter file to take a \hyperlink{classGraph}{Graph} data structure and convert into a \char`\"{}.dot\char`\"{} formatted file than can be passed to GraphViz.  


\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static \hyperlink{classGraphVizExporter_a63ee3eef62e8e371f65a7b835ff7e03e}{createDot} (\$graph)
\begin{DoxyCompactList}\small\item\em Loops through the passed graph structure and writes it to a text string in the .dot file format. \item\end{DoxyCompactList}\item 
\hypertarget{classGraphVizExporter_ab48d8f07e6c16c1e822cc762b5276b0c}{
static {\bfseries getWeightGV} (\$value)}
\label{classGraphVizExporter_ab48d8f07e6c16c1e822cc762b5276b0c}

\item 
static \hyperlink{classGraphVizExporter_a5ffcde0b5a56dd0a8ac57680f247520b}{generateGraphFiles} (\$graph, \$datapath, \$format)
\begin{DoxyCompactList}\small\item\em Manage the export of the \hyperlink{classGraph}{Graph} object, piping the .dot file to GraphViz to compute layouts, and cacheing images,etc. \item\end{DoxyCompactList}\item 
static \hyperlink{classGraphVizExporter_a7f97288f0c6800015bbe0101cbe38b7d}{generateGraphvizOutput} (\$graph, \$datapath, \$format, \$returnsvg=0)
\begin{DoxyCompactList}\small\item\em Determines if the network image files need to be generated or loaded from cache, and loads information into arrays to be returned to client. \item\end{DoxyCompactList}\item 
static \hyperlink{classGraphVizExporter_ae10671113e79e66c0cd8b5ea3113b76c}{processImap} (\$imap, \$datapath, \$graphname)
\begin{DoxyCompactList}\small\item\em Modifies some elements of the .imap file generated by GraphViz to make it appropriate to insert into our XHTML page, writes out .imap file to cache directory. \item\end{DoxyCompactList}\item 
static \hyperlink{classGraphVizExporter_a514360e45b911c0efcf51c3ffb4e783a}{processSVG} (\$svgFile, \$datapath, \$graph)
\begin{DoxyCompactList}\small\item\em Modifies the SVG rendering of the network produced by GraphViz to be ready to insert into the XHTML document, tweaks some elements to work better in the NodeViz interactive display. \item\end{DoxyCompactList}\item 
\hypertarget{classGraphVizExporter_a9312bb23e4f82aee8beee585cc28e5a3}{
static {\bfseries processGraphData} (\$data, \$datapath, \$graphname)}
\label{classGraphVizExporter_a9312bb23e4f82aee8beee585cc28e5a3}

\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
static \hyperlink{classGraphVizExporter_a227940f38a3a387e9225d563e1170578}{\$GV\_\-PARAMS}
\begin{DoxyCompactList}\small\item\em Global vars that allow tweaking settings of sections in dot file and setting how neato will run when it reads the file. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Interpreter file to take a \hyperlink{classGraph}{Graph} data structure and convert into a \char`\"{}.dot\char`\"{} formatted file than can be passed to GraphViz. Manages launching and running GraphVis program to do the graph layout. Also includes functions to clean up SVG and imagemap files. 

\subsection{Member Function Documentation}
\hypertarget{classGraphVizExporter_a63ee3eef62e8e371f65a7b835ff7e03e}{
\index{GraphVizExporter@{GraphVizExporter}!createDot@{createDot}}
\index{createDot@{createDot}!GraphVizExporter@{GraphVizExporter}}
\subsubsection[{createDot}]{\setlength{\rightskip}{0pt plus 5cm}static GraphVizExporter::createDot (
\begin{DoxyParamCaption}
\item[{\$}]{graph}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classGraphVizExporter_a63ee3eef62e8e371f65a7b835ff7e03e}


Loops through the passed graph structure and writes it to a text string in the .dot file format. 

All graph data will be written, even if it is not a valid GraphViz paramters. When some important GraphViz params are not included, it uses the default values in \$GV\_\-PARAMS. 
\begin{DoxyParams}{Parameters}
{\em \$graph} & the graph to be converted \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\$dot a string in .dot format ready to be written out 
\end{DoxyReturn}
\hypertarget{classGraphVizExporter_a5ffcde0b5a56dd0a8ac57680f247520b}{
\index{GraphVizExporter@{GraphVizExporter}!generateGraphFiles@{generateGraphFiles}}
\index{generateGraphFiles@{generateGraphFiles}!GraphVizExporter@{GraphVizExporter}}
\subsubsection[{generateGraphFiles}]{\setlength{\rightskip}{0pt plus 5cm}static GraphVizExporter::generateGraphFiles (
\begin{DoxyParamCaption}
\item[{\$}]{graph, }
\item[{\$}]{datapath, }
\item[{\$}]{format}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classGraphVizExporter_a5ffcde0b5a56dd0a8ac57680f247520b}


Manage the export of the \hyperlink{classGraph}{Graph} object, piping the .dot file to GraphViz to compute layouts, and cacheing images,etc. 

First creates graph file using \hyperlink{classGraphVizExporter_a63ee3eef62e8e371f65a7b835ff7e03e}{createDot()}. Uses neato network layout by default, other graphviz layouts can be specified iwht the layoutEngine parameter. Uses the Graph's graphname() function for the base of the filename. Normally writes out a .dot, .svg .png and .imap versions of the network. If debugMode is set, it will also write out a human-\/readable dot file with a suffix .nicegraph. Post-\/processes the .imap, .svg and ? file using the fuctions \hyperlink{classGraphVizExporter_ae10671113e79e66c0cd8b5ea3113b76c}{processImap()}, \hyperlink{classGraphVizExporter_a514360e45b911c0efcf51c3ffb4e783a}{processSVG()} and processGraphData(). 
\begin{DoxyParams}{Parameters}
{\em \$graph} & the \hyperlink{classGraph}{Graph} object to be exported \\
\hline
{\em \$datapath} & the data working directory that the files should be witten to \\
\hline
{\em \$format} & string giving suffix for other image format to save graph images as. (i.e. \char`\"{}.jpg\char`\"{}) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an array with \$imap and \$svg elements 
\end{DoxyReturn}
\hypertarget{classGraphVizExporter_a7f97288f0c6800015bbe0101cbe38b7d}{
\index{GraphVizExporter@{GraphVizExporter}!generateGraphvizOutput@{generateGraphvizOutput}}
\index{generateGraphvizOutput@{generateGraphvizOutput}!GraphVizExporter@{GraphVizExporter}}
\subsubsection[{generateGraphvizOutput}]{\setlength{\rightskip}{0pt plus 5cm}static GraphVizExporter::generateGraphvizOutput (
\begin{DoxyParamCaption}
\item[{\$}]{graph, }
\item[{\$}]{datapath, }
\item[{\$}]{format, }
\item[{\$}]{returnsvg = {\ttfamily 0}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classGraphVizExporter_a7f97288f0c6800015bbe0101cbe38b7d}


Determines if the network image files need to be generated or loaded from cache, and loads information into arrays to be returned to client. 

Contents of image and overly change depending if the browser making the request set useSVG request parameter. 
\begin{DoxyParams}{Parameters}
{\em \$graph} & the \hyperlink{classGraph}{Graph} object, to be returned as JSON. \\
\hline
{\em \$datapath} & string giving the path to the cache directory \\
\hline
{\em \$format} & string indicating if it will be returning svg or png image for network? \\
\hline
{\em \$returnsvg} & NOT USED? seems to read request param instead. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an array with elements for the 'image', 'graph', 'overlay', and 'dot' data. 
\end{DoxyReturn}
\hypertarget{classGraphVizExporter_ae10671113e79e66c0cd8b5ea3113b76c}{
\index{GraphVizExporter@{GraphVizExporter}!processImap@{processImap}}
\index{processImap@{processImap}!GraphVizExporter@{GraphVizExporter}}
\subsubsection[{processImap}]{\setlength{\rightskip}{0pt plus 5cm}static GraphVizExporter::processImap (
\begin{DoxyParamCaption}
\item[{\$}]{imap, }
\item[{\$}]{datapath, }
\item[{\$}]{graphname}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classGraphVizExporter_ae10671113e79e66c0cd8b5ea3113b76c}


Modifies some elements of the .imap file generated by GraphViz to make it appropriate to insert into our XHTML page, writes out .imap file to cache directory. 


\begin{DoxyParams}{Parameters}
{\em \$imap} & string with contents of .imap file \\
\hline
{\em \$datapath} & string giving location of cache directory \\
\hline
{\em \$graphname} & string giving base name of graph to be used in filename \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\$imap modified string with contents of imap file 
\end{DoxyReturn}
\hypertarget{classGraphVizExporter_a514360e45b911c0efcf51c3ffb4e783a}{
\index{GraphVizExporter@{GraphVizExporter}!processSVG@{processSVG}}
\index{processSVG@{processSVG}!GraphVizExporter@{GraphVizExporter}}
\subsubsection[{processSVG}]{\setlength{\rightskip}{0pt plus 5cm}static GraphVizExporter::processSVG (
\begin{DoxyParamCaption}
\item[{\$}]{svgFile, }
\item[{\$}]{datapath, }
\item[{\$}]{graph}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classGraphVizExporter_a514360e45b911c0efcf51c3ffb4e783a}


Modifies the SVG rendering of the network produced by GraphViz to be ready to insert into the XHTML document, tweaks some elements to work better in the NodeViz interactive display. 

Writes out the new SVG file and (when not in debug mode) deltes the old SVG file. Key changes to SVG are:
\begin{DoxyItemize}
\item adding a large 'screen' which will be used to hide the graph when certain elements are hilited
\item changing the id of the svg element
\item removing svg document header
\item removing title tags
\item adding a zoom\_\-level class to text elements to work with the css zooming
\item rewriting image paths from local to web paths 
\begin{DoxyParams}{Parameters}
{\em \$svgFile} & string with the name of the file containing the SVG content \\
\hline
{\em \$datapath} & string with the location of the cache directory where files are location \\
\hline
{\em \$graph} & the \hyperlink{classGraph}{Graph} object corresponding to the SVG image. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\$svg string with modified SVG content 
\end{DoxyReturn}

\end{DoxyItemize}

\subsection{Member Data Documentation}
\hypertarget{classGraphVizExporter_a227940f38a3a387e9225d563e1170578}{
\index{GraphVizExporter@{GraphVizExporter}!\$GV\_\-PARAMS@{\$GV\_\-PARAMS}}
\index{\$GV\_\-PARAMS@{\$GV\_\-PARAMS}!GraphVizExporter@{GraphVizExporter}}
\subsubsection[{\$GV\_\-PARAMS}]{\setlength{\rightskip}{0pt plus 5cm}GraphVizExporter::\$GV\_\-PARAMS\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classGraphVizExporter_a227940f38a3a387e9225d563e1170578}
{\bfseries Initial value:}
\begin{DoxyCode}
 array(
        'graph' => array(
            'outputorder' => 'edgesfirst',  
            'truecolor' => 'true',
            
            'size' => '9,9!',
            'dpi' => '96',
            
            'bgcolor' => 'transparent',
            'splines' => '1',
            'epsilon'=>'0.0',
            'layoutEngine'=>'neato',
            #'ratio'=>'fill'
        ),
        'node' => array(
            'style' => 'setlinewidth(16), filled',
            'fontsize' => '10',
            'fixedsize' => 'true', 
            'label'=>' ',
            'imagescale'=>'true'
        ),
        'edge' => array(
            'len' => '8',
            'style'=>'setlinewidth(2)',
            'labelfloat' => 'true'
        )
    )
\end{DoxyCode}


Global vars that allow tweaking settings of sections in dot file and setting how neato will run when it reads the file. 

See \href{http://www.graphviz.org/doc/info/attrs.html}{\tt http://www.graphviz.org/doc/info/attrs.html} for list of params and dfns. Used as default values but can be overridden in \hyperlink{classGraph}{Graph} setup files. 

The documentation for this class was generated from the following file:\begin{DoxyCompactItemize}
\item 
/home/skyebend/checkouttest/nodeviz/www/NodeViz/library/GraphVizExporter.php\end{DoxyCompactItemize}
